package com.qingcheng.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.qingcheng.dao.AdminRoleMapper;
import com.qingcheng.service.system.AdminRoleService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class AdminRoleServiceImpl implements AdminRoleService {
    @Autowired
    private AdminRoleMapper adminRoleMapper;

    /**
     * 通过管理员id与角色id更新角色中间表
     * */
    public void add(Integer adminId, Integer roleId) {
        adminRoleMapper.add(adminId,roleId);
    }

    /**
     * 通过管理员id来查询角色id列表
     * */
    public List<Integer> findById(Integer adminId) {
        return adminRoleMapper.findById(adminId);
    }

    /**
     * 通过adminId删除管理员角色中间表关联数据
     * */
    public void deleteById(Integer adminId) {
        adminRoleMapper.deleteById(adminId);
    }
}
